package com.norriekoelle.virtualsensors.shared;

import com.norriekoelle.virtualsensors.client.BookDatabaseAdapter.Collection;
import com.norriekoelle.virtualsensors.client.BookDatabaseAdapter.ObjectType;

/**
 * A model to hold our book textures in the database.
 * 
 * @author Lauren Norrie (norrielm)
 */
public class BookshelfObject {

	private String index;
	private String bookName;
	private Collection bookCategory;
	private String drawableResourceId;
	// TODO(norrielm): Pull the object type into this class rather than the adapter.
	private ObjectType type;
	
	public BookshelfObject(String databaseId, String name, Collection category, 
			String drawableResourceId, ObjectType type) {
		this.index = databaseId;
		this.bookName = name;
		this.bookCategory = category;
		this.drawableResourceId = drawableResourceId;
		this.type = type;
	}

	public void setDatabaseId(String databaseId) {
		this.index = databaseId;
	}

	public String getDatabaseId() {
		return index;
	}

	public void setDrawableResourceId(String drawableResourceId) {
		this.drawableResourceId = drawableResourceId;
	}

	public String getDrawableResourceId() {
		return drawableResourceId;
	}

	public void setType(ObjectType type) {
		this.type = type;
	}

	public ObjectType getType() {
		return type;
	}

	public String getBookName() {
		return bookName;
	}

	public void setBookName(String bookName) {
		this.bookName = bookName;
	}

	public Collection getBookCategory() {
		return bookCategory;
	}

	public void setBookCategory(Collection bookCategory) {
		this.bookCategory = bookCategory;
	}	
	
	public String toString() {
		return String.format("%s in %s", this.bookName, this.bookCategory.getName());
	}
}
